import java.util.Scanner;

public class memberCard {
    //id为输入的四位数卡号
    private String id;


    //卡号和
    public int sumId() {
        int sum = 0;
        for (int i = 0; i < id.length(); i++) {
            sum += id.charAt(i)-48;
        }
        return sum;
    }


    //构造函数1
    public memberCard() {
    }

    //构造函数2
    public memberCard(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "memberCard{" +
                "id='" + id + '\'' +
                '}';
    }
}
